﻿//-----------------------------------------------------------------------
// <copyright file="NannyFactory.cs" company="Mulala">
//     Copyright Mulala. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Mulala.Cavan.Domain.MainBoundedContext.NannyModule
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Mulala.Cavan.Domain.MainBoundedContext.CorporationModule;
    using Mulala.Cavan.Domain.MainBoundedContext.DictionaryModule;
    using Mulala.Cavan.Domain.MainBoundedContext.ConsignModule;
    using Mulala.Cavan.Domain.MainBoundedContext.SecurityModule;
    using Mulala.Cavan.Domain.MainBoundedContext.Setting;

    public static class NannyFactory
    {
        public static Nanny CreateNanny(
                                Corporation corporation,
                                UserAccount userAccount,
                                string name,
                                int age,
                                NannyIdentifier.Sex sex,
                                int nation,
                                DateTime birthday,
                                string telephone,
                                string mobile,
                                string qq,
                                string msn,
                                bool isContactCompany,
                                int astrology,
                                int computerLevel,
                                int chineseZodiac,
                                bool isMarried,
                                long language,
                                Area area,
                                string address,
                                int degree,
                                bool canDrive,
                                bool hasChildren,
                                int healthy,
                                int faith,
                                long mainSkill,
                                long firstSkill,
                                long secondSkill,
                                long thirdSkill,
                                bool isTrained,
                                int experience,
                                int salary,
                                string introduce,
                                long certificate,
                                string declaration,
                                NannyIdentifier.NannyType type,
                                bool isWorking,
                                bool isNeedAccommodate,
                                bool isNeedMeal,
                                int satisfactoryTotal,
                                int commentTotal,
                                int viewTotal,
                                int searchTotal,
                                bool isDeleted,
                                NannyStatus nannyStatus,
                                IList<NannyComment> comments,
                                IList<NannyDiary> diarys,
                                IList<Consign> consigns,
                                DateTime editTime,
                                string editUser)
        {
            Nanny nanny = new Nanny();
            nanny.UserAccount = userAccount;
            nanny.Address = address;
            nanny.Age = age;
            nanny.Area = area;
            nanny.Astrology = astrology;
            nanny.Birthday = birthday;
            nanny.CanDrive = canDrive;
            nanny.ChineseZodiac = chineseZodiac;
            nanny.Comments = comments;
            nanny.CommentTotal = commentTotal;
            nanny.ComputerLevel = computerLevel;
            nanny.Consigns = consigns;
            nanny.Corporation = corporation;
            nanny.Certificate = certificate;
            nanny.Declaration = declaration;
            nanny.Degree = degree;
            nanny.Diarys = diarys;
            nanny.EditTime = editTime;
            nanny.EditUser = editUser;
            nanny.Experience = experience;
            nanny.Salary = salary;
            nanny.Faith = faith;
            nanny.FirstSkill = firstSkill;
            nanny.HasChildren = hasChildren;
            nanny.Healthy = healthy;
            nanny.Introduce = introduce;
            nanny.IsContactCompany = isContactCompany;
            nanny.IsDeleted = isDeleted;
            nanny.IsMarried = isMarried;
            nanny.IsTrained = isTrained;
            nanny.IsWorking = isWorking;
            nanny.IsNeedAccommodate = isNeedAccommodate;
            nanny.IsNeedMeal = isNeedMeal;
            nanny.Language = language;
            nanny.MainSkill = mainSkill;
            nanny.Mobile = mobile;
            nanny.MSN = msn;
            nanny.Name = name;
            if (null != nannyStatus)
            {
                nanny.NannyStatus = nannyStatus;
                nannyStatus.Nanny = nanny;
            }
            nanny.Nation = nation;
            nanny.QQ = qq;
            nanny.SatisfactoryTotal = satisfactoryTotal;
            nanny.SearchTotal = searchTotal;
            nanny.SecondSkill = secondSkill;
            nanny.Sex = sex;
            nanny.Telephone = telephone;
            nanny.ThirdSkill = thirdSkill;
            nanny.Type = type;
            nanny.ViewTotal = viewTotal;
            nanny.CreateTime = DateTime.Now;

            return nanny;
        }

        public static Nanny CreateNanny(Corporation corporation, UserAccount userAccount, Area area, NannyStatus nannyStatus)
        {
            Nanny nanny = NannyFactory.CreateNanny(corporation, userAccount, Project.Settings.DefaultInfo, 0, NannyIdentifier.Sex.Female, 0, DateTime.Parse(Project.Settings.DefaultTime),
                Project.Settings.DefaultInfo, Project.Settings.DefaultInfo, Project.Settings.DefaultInfo, Project.Settings.DefaultInfo, false, 0, 0, 0, false, 0,
                area, Project.Settings.DefaultInfo, 0, false, false, 0, 0, 0, 0, 0, 0, false, 0, 0, Project.Settings.DefaultInfo, 0, Project.Settings.DefaultInfo,
                NannyIdentifier.NannyType.Nanny, false, false, false, 0, 0, 0, 0, false, nannyStatus, null, null, null, DateTime.Now, userAccount.Name);

            return nanny;
        }

        public static Nanny CreateNanny(int id)
        {
            Nanny nanny = new Nanny();
            nanny.ID = id;

            return nanny;
        }
    }
}
